package 图.树;
import java.util.List;
import java.util.ArrayList;
public class TreeSummary {
	/**
	 * leetcode 589 N叉树 的遍历
	 */
	static List<Integer> ans = new ArrayList<>();
	static class Node{
		public int val;
		public List<Node> children;
		public Node(int val) {
			this.val=val;
		}
		public Node(int val,List<Node> children) {
			this.val=val;
			this.children = children;
		}
	}
	public static void solution(Node root) {
		if(root == null) {
			return ;
		}
		// 前序遍历
		ans.add(root.val);
		for(Node node : root.children) {
			solution(node);
		}
	}
}
